package com.imooc.order.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * EnvController
 *
 * @author leon.cheng
 * @date 2018/12/11 14:17
 **/
@RestController
@RequestMapping("/env")
//@RefreshScope
public class EnvController {
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Value("${env}")
    private String env;
    @GetMapping("/print")
    public String print(){
        redisTemplate.opsForValue().set("123","123456");
        return env;
    }
}
